﻿using FunctionalCLR.Core;

namespace FunctionalCLR.Core {
    public class DefaultParserFactory : AbstractParserFactory {

        public override Parser CreateParser(string expr) {
            Parser parser = new Parser(expr);
            parser.ConstantManager
                = DefaultDependencyManager.Instance.ConstantManager;
            parser.FunctionManager
                = DefaultDependencyManager.Instance.FunctionManager;
            parser.ParserFactory = this;

            return parser;
        }

        public override Parser CreateParser(string expr, object context) {
            return this.CreateParser(expr);
        }

    }
}
